#pragma once
#include "gameroom.h"

class Field;
class Player;
class PVPManager;

class GamePVPRoom : public GameRoom
{
	enum { MAX_PVP_TEAM_NUM = 10, };

	__DECL_GAMEZONEPOOL(GamePVPRoom)
public:
	GamePVPRoom(void);
	virtual ~GamePVPRoom(void);
	virtual VOID Release();
	VOID Init( KEYTYPE Key, CODETYPE MapCode, const TCHAR * pszRoomTitle, const TCHAR * pszRoomPWD, const BASE_ROOMINFO * IN pRoomInfo, const ADDITIONAL_PVPINFO * IN pAdditionalPVPInfo );

	inline PVPManager *	GetPVPManager() { return m_pPVPManager;	}

	virtual eZONETYPE	GetZoneType() { return eZONETYPE_PVP;	}
	virtual VOID		Ready( Player * pPlayer, CODETYPE FieldCode, WzID AreaID );
	virtual BOOL		Join( Player * pPlayer, CODETYPE FieldCode, WzID AreaID );
	virtual VOID		Leave( Player * pPlayer );
	virtual VOID		Update( DWORD dwDeltaTick );

	virtual VOID		ChangeMaster(DWORD dwNextMasterUserKey ) { SetMasterUserKey( dwNextMasterUserKey ); }

	virtual CODETYPE	GetEntryFieldCode();
	virtual const ADDITIONAL_PVPINFO *	GetAdditionalPVPInfo()	{ return &m_AdditionalPVPInfo; }

protected:
	inline VOID			SetAdditionalPVPInfo(const ADDITIONAL_PVPINFO * pInfo) { memcpy(&m_AdditionalPVPInfo, pInfo, sizeof(ADDITIONAL_PVPINFO)); }
private:
	ADDITIONAL_PVPINFO	m_AdditionalPVPInfo;
	PVPManager *		m_pPVPManager;
};
